package com.wlc.oop.demo08.interface3;

/**
 * @author 王立朝 wanglichao@champion-credit.com
 * @description 猫
 * @date 2021-07-08 08:13
 */
public class Cat extends Animal implements Pet {
    /**
     * 名字
     */
    private String name;

    /**
     * 受保护的构造方法
     *
     * @param name
     */
    protected Cat(String name) {
        super(4);
        this.name = name;
    }
    protected Cat(){
        this("");
    }

    @Override
    protected void eat() {
        System.out.println("猫吃饭啦");
    }

    @Override
    public void setName(String name) {
     this.name = name;
    }

    @Override
    public String getName() {
        return name;
    }

    @Override
    public void play() {
        System.out.println("猫在玩耍。。");
    }
}
